export const getNameById = (data, id, key) => {
  const index = data.findIndex(item => item.id === id)
  if (index > -1) {
    return data[index][key]
  } else {
    return ''
  }
}
